<?php
/**
 * Created by litong on Date: 2019/2/24 0024 下午 9:47
 */
$host="localhost";$username="root";$password="";$dbname="php_study";
$connection = mysqli_connect($host, $username, $password, $dbname);
$sql = "INSERT INTO my_guests (firstname, lastname, email)VALUES ('John', 'Doe', 'john@example.com');";
$sql .= "INSERT INTO my_guests (firstname, lastname, email)VALUES ('Mary', 'Moe', 'mary@example.com');";
$sql .= "INSERT INTO my_guests (firstname, lastname, email)VALUES ('Julie', 'Dooley', 'julie@example.com')";
if(mysqli_multi_query($connection,$sql)){
  echo "执行成功";
}else{
  echo mysqli_error($connection);
}
